ifeq ($(DAVINCI_HIAI_DKMS),y)
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/pcie_host/soc_adapt
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/pcie_host
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/common_h
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc_open/inc
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc_open/inc/depends/
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc_open/inc/depends/log
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc_open/inc/depends/vpc
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/pcie_host/interfaces
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/libc_sec/include

    ifeq ($(TARGET_PRODUCT),cloud)
        ifeq ($(TARGET_CHIP_ID), $(A9XXGEN02M01))
            EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_ESL_FPGA
        else
            EXTRA_CFLAGS += -DCFG_FEATURE_DMI
        endif
        ifeq ($(TARGET_CHIP_ID), hi1980b)
            EXTRA_CFLAGS += -DCFG_FEATURE_SRIOV
            EXTRA_CFLAGS += -DCFG_FEATURE_PASSID
        endif
    endif
else
    ifeq ($(ENABLE_OPEN_SRC),y)
        EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/inc/depends/sec
    else
        EXTRA_CFLAGS += -I$(TOP_DIR)/abl/libc_sec/include
    endif
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/inc/
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/inc/depends/
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/inc/depends/vpc
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/inc/depends/log
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/src/drv_pcie/common_h/
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/src/drv_pcie/pcie_host/
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/src/drv_pcie/pcie_host/soc_adapt/

    ifneq ($(filter $(PRODUCT),  ascend910),)
        EXTRA_CFLAGS += -DCFG_FEATURE_DMI
    endif

    ifneq ($(filter $(PRODUCT),  ascend910B),)
        EXTRA_CFLAGS += -DCFG_FEATURE_DMI
        EXTRA_CFLAGS += -DCFG_FEATURE_SRIOV
        EXTRA_CFLAGS += -DCFG_FEATURE_PASSID
    endif

    ifneq ($(filter $(PRODUCT),  as31xm1),)
        EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_MDC_V11
        EXTRA_CFLAGS += -DCFG_FEATURE_PCIE_LINK_INFO
    endif
endif

ifeq ($(filter $(PRODUCT),  ascend310p),)
    EXTRA_CFLAGS += -DCFG_FEATURE_DEVICE_310P
endif

EXTRA_CFLAGS += -DCFG_HOST
ifneq ($(NOT_SUPPORT_SP), y)
    EXTRA_CFLAGS += -fstack-protector-all
endif

ifeq ($(ENABLE_ASAN),true)
    EXTRA_CFLAGS += -DCFG_ENABLE_ASAN
endif
ifeq ($(CUSTOM_OS_CCFLAGS), )
ccflags-y += -Wall -Werror -Wtrampolines $(WDATE_TIME) -Wfloat-equal -Wvla -Wundef -funsigned-char -Wformat=2 -Wstack-usage=2048 -Wcast-align
ccflags-y += -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers -Wno-format-nonliteral -Wno-empty-body
else
ccflags-y += $(CUSTOM_OS_CCFLAGS)
endif
obj-m   += drv_pcie_host.o
drv_pcie_host-objs := devdrv_dma.o devdrv_msg.o devdrv_ctrl.o devdrv_sysfs.o devdrv_pci.o devdrv_common_msg.o devdrv_device_load.o
drv_pcie_host-objs += devdrv_atu_interface.o devdrv_vpc.o
drv_pcie_host-objs += interfaces/devdrv_dma_interface.o
drv_pcie_host-objs += devdrv_pcie_link_info.o

drv_pcie_host-objs += soc_adapt/res_drv.o soc_adapt/dma_adapt.o soc_adapt/nvme_adapt.o soc_adapt/res_drv_mini_v1.o soc_adapt/res_drv_mini_v2.o soc_adapt/res_drv_cloud_v1.o soc_adapt/res_drv_cloud_v2.o soc_adapt/res_drv_mini_v3.o


